<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      layout:decorate="~{admin/layout}">
<body>

<div  class="content-wrap" layout:fragment="content">
    <main id="content" class="content" role="main">
        <ol class="breadcrumb">
            <li>苗木管理</li>
            <li class="active">苗木出库</li>
        </ol>
        <section class="widget">
            <header>
                <div class="widget-controls">
                    <a data-widgster="expand" title="Expand" href="#"><i class="glyphicon glyphicon-chevron-up"></i></a>
                    <a data-widgster="collapse" title="Collapse" href="#"><i class="glyphicon glyphicon-chevron-down"></i></a>
                    <a data-widgster="close" title="Close" href="#"><i class="glyphicon glyphicon-remove"></i></a>
                </div>
            </header>
            <div class="widget-body">
                <form th:action="@{/admin/tree/direction}" class="input-group mt" style="width: 30%;">
                    <input type="text" class="form-control" name="direction" placeholder="输入去向">
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-default">
                            <i class="fa fa-search text-gray"></i>
                        </button>
                    </span>
                </form>
                <div class="mt">
                    <table  class="table table-striped table-hover">
                        <thead>
                            <tr>
                                <th class="no-sort hidden-sm-down">苗木数量</th>
                                <th class="hidden-sm-down">位置</th>
                                <th class="hidden-sm-down">树种</th>
                                <th class="no-sort">胸径</th>
                                <th class="no-sort">高度</th>
                                <th class="no-sort">去向</th>
                                <shiro:hasAnyRoles name="admin,finance">
                                    <th class="no-sort">是否收费</th>
                                </shiro:hasAnyRoles>
                                <th class="no-sort">出库时间</th>
                            </tr>
                        </thead>
                        <tbody>
                        <tr th:each="trees :${trees}">
                            <td th:text="${trees.number}"></td>
                            <td class="check" th:text="${trees.serialNumber}"></td>
                            <td class="check" th:text="${trees.treeSpecies}"></td>
                            <td class="check"  th:text="${trees.chestBreadth}"></td>
                            <td class="check"  th:text="${trees.height}"></td>
                            <td th:text="${trees.direction}"></td>
                            <shiro:hasAnyRoles name="admin,finance">
                                <td>
                                    <div th:switch="${trees.gather}">
                                        <span th:case=true>已收费</span>
                                        <a th:case=false th:href="@{/admin/tree/gather(tree_id=${trees.tree_id})}"><input type="button" value="确认收费"></a>
                                    </div>
                                </td>
                            </shiro:hasAnyRoles>
                            <td th:text="${trees.outWarehouseTime}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>
        <script>
            checknumber();
        </script>
    </main>
</div>
</body>
</html>